<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="${ctxPath}/static/police/css/common.css?a=2">
    <link rel="stylesheet" type="text/css" href="${ctxPath}/static/police/css/style.css?a=2">
    <script src="${ctxPath}/static/assets/js/jquery.js" type="text/javascript"></script>
    <script src="${ctxPath}/static/blade/js/blade-toolbox.js" type="text/javascript"></script>
    <script src="${ctxPath}/static/blade/js/blade-ajax.js" type="text/javascript"></script>
    <script src="${ctxPath}/static/layer/layer.js"></script>
</head>
<body class="login_Bg">
<div class="login_title"><img src="${ctxPath}/static/police/images/h-title.png"/></div>
<div class="login_wrap">
    <div class="login_header">
        <img class="logo" src="${ctxPath}/static/police/images/logo.png?a=2"/>
        <h3 class="h3_title">出租屋智能管理系统</h3>
    </div>

        <form method="post" id="loginform" data-imgcode="imgcode" action="${ctxPath}/admin/login">
        <div class="loginBox">
            <div class="login_line">
                <input class="text" placeholder="请输入账号" type="text" name="account" />
            </div>
            <div class="login_line">
                <input class="text" placeholder="请输入密码" id="password" type="password" name="password"/>
            </div>
            <div class="login_line login_abs">
                <input class="text" name="imgCode" placeholder="请输入验证码" type="text"/>
                <img id="imgcode" class="code" src="${ctxPath}/captcha" onclick="this.src = '${ctxPath}/captcha?v=' + Math.random()" height="35" />
            </div>
            <div class="login_other" style="display:none">
                <span class="check mr8"></span>
                <span>记住账号</span>
            </div>
           <div class="tc" style="margin-top: 40px"> <button class="login_btn"  type="submit" >登录</button></div>
        </div>
        </form>
    </div>
    <script type="text/javascript" src="${ctxPath}/static/police/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="${ctxPath}/static/police/js/base.js"></script>
    <script type="text/javascript">
        // 登录
        $("form").submit(function(){
            var $form = $(this);
            var $imgcode=$("#"+$form.attr("data-imgcode"));
            var ajax = new Ajax($form.attr("action"), function(data){
                if (data.code === 0) {
                    layer.msg(data.message, {shift: 1});
                    setTimeout(function(){window.location.href = BladeApp.getCtx() + "/admin/model";}, 1200);
                    return false;
                } else {
                    layer.msg(data.message, {shift: 6});
                    $imgcode.click();
                    return false;
                }
            });
            ajax.data = $form.serialize();
            ajax.start();
            return false;
        });
    </script>
</body>
</html>